<?php
namespace app\center\logic;

class CopyReplyLogic extends BaseLogic {

    /**
     * 获取抄送批复查询条件
     * @param $openid
     * @param $copy_openid
     * @param $source
     * @param $start_time
     * @return array
     */
    public function get_search_cr_maps($openid,$copy_openid,$source,$start_time){
        $maps = [];
        $maps[] = ['from_openid','=',$openid];
        $maps[] = ['explain','<>',''];
        $maps[] = ['status','=',1];

        if(!empty($copy_openid)){
            $maps[] = ['copy_openid','=',$copy_openid];
        }

        if($source != -1){
            $maps[] = ['source','=',$source];
        }

        if(!empty($start_time)){
            $maps[] = ['c_time','like',$start_time . '%'];
        }
        return $maps;
    }
}